package com.HelloWord;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Created by onlylove on 2017/3/13.
 */
public class ArrayTest {
    public static void main(String args[]){
        List<String> mylist = new ArrayList<String>();
        mylist.add("张同学");
        mylist.add("李同学");
        mylist.add("王同学");
        mylist.add("陈同学");
        for (int i = 0; i < mylist.size(); i++) {
            // for 效率高。
            System.out.println(mylist.get(i));
            System.out.println("-----------");
        }
//        Iterator it = mylist.iterator();
//        while (it.hasNext()){
//            System.out.println(it.next());
//        }
    }
}
